package edu.xlh.travel.dao;

import edu.xlh.travel.pojo.ScoreDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface ScoreDetailDao extends JpaRepository<ScoreDetail,String>, JpaSpecificationExecutor<ScoreDetail> {
    List<ScoreDetail> findByUserId(String userId);

    @Transactional
    @Modifying
    @Query(value = "update ScoreDetail set delFlag =?2 where id =?1")
    void updateScoreDetailDelFlagByScoreDetailId(String detailId, String delFlag);
}
